package PackageTest;

import PackageComplex.Complex;

public class Test {
    public static void main(String[] args) {
        Complex testA = new Complex(1, 2);
        Complex testB = new Complex(2, -3);
        System.out.println(testA.complexAdd(testB).ToString());
        System.out.println(testA.ToString());
        System.out.println(testA.complexSub(testB).ToString());
        System.out.println(testA.ToString());
        System.out.println(testA.complexMul(testB).ToString());
        System.out.println(testA.ToString());
        System.out.println(testA.modulus());
        Complex[] arr = new Complex[3];
        arr[0] = new Complex(3,5);
        arr[1] = new Complex(4,3);
        arr[2] = new Complex(5,4);
        Complex temp = new Complex();
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr.length - 1 - i; j++) {
                if (arr[j].modulus() < arr[j + 1].modulus()){
                    temp = arr[j + 1];
                    arr[j + 1] = arr[j];
                    arr[j] = temp;
                }else {
                    temp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = temp;
                }
            }
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i].ToString());
        }
    }
}
